package charpter14.lynx;

import generics.coffee.Americano;
import generics.coffee.Breve;
import generics.coffee.Cappuccino;
import generics.coffee.Coffee;
import generics.coffee.Latte;
import generics.coffee.Mocha;

import java.util.ArrayList;
import java.util.List;

import typeinfo.factory.Factory;

public class Sixteen {
	public static final List<Factory<? extends Coffee>> coffeeList = new ArrayList<Factory<? extends Coffee>>();
	
	static {
		coffeeList.add(new Americano.Factory());
		coffeeList.add(new Breve.Factory());
		coffeeList.add(new Cappuccino.Factory());
		coffeeList.add(new Latte.Factory());
		coffeeList.add(new Mocha.Factory());
	}
	
	public static void main(String[] args) {
		for (Factory<? extends Coffee> coffeeFactory : coffeeList) {
			System.out.println(coffeeFactory.create());
		}
	}
}
